{ "org.gnome.desktop.interface", "cursor-blink", "gtk-cursor-blink", G_TYPE_BOOLEAN, { .b = TRUE } },
{ "org.gnome.desktop.interface", "cursor-blink-time", "gtk-cursor-blink-time", G_TYPE_INT, { .i = 1200 } },
{ "org.gnome.desktop.interface", "cursor-blink-timeout", "gtk-cursor-blink-timeout", G_TYPE_INT, { .i = 3600 } },
- { "org.gnome.desktop.interface", "menus-have-icons", "gtk-menu-images", G_TYPE_BOOLEAN, { .b = FALSE } },
{ "org.gnome.desktop.interface", "gtk-im-module", "gtk-im-module", G_TYPE_STRING, { .s = "simple" } },
{ "org.gnome.desktop.interface", "enable-animations", "gtk-enable-animations", G_TYPE_BOOLEAN, { .b = TRUE } },
{ "org.gnome.desktop.interface", "automatic-mnemonics", "gtk-auto-mnemonics", G_TYPE_BOOLEAN, { .b = TRUE } },
/**
* GtkAction:always-show-image:
*
- * If %TRUE, the action's menu item proxies will ignore the #GtkSettings:gtk-menu-images
- * setting and always show their image, if available.
+ * If %TRUE, the action's menu item proxies will always show their image, if available.
*
* Use this property if the menu item would be useless or hard to use
* without their image.
* @action: a #GtkAction
* @always_show: %TRUE if menuitem proxies should always show their image
*
- * Sets whether @action<!-- -->'s menu item proxies will ignore the
- * #GtkSettings:gtk-menu-images setting and always show their image, if available.
+ * Sets whether @action<!-- -->'s menu item proxies will always show
+ * their image, if available.
*
* Use this if the menu item would be useless or hard to use
* without their image.
* gtk_action_get_always_show_image:
* @action: a #GtkAction
*
- * Returns whether @action<!-- -->'s menu item proxies will ignore the
- * #GtkSettings:gtk-menu-images setting and always show their image,
- * if available.
+ * Returns whether @action<!-- -->'s menu item proxies will always
+ * show their image, if available.
*
* Returns: %TRUE if the menu item proxies will always show their image
*
guint prop_id,
GValue *value,
GParamSpec *pspec);
-static void gtk_image_menu_item_screen_changed (GtkWidget *widget,
- GdkScreen *previous_screen);
static void gtk_image_menu_item_recalculate (GtkImageMenuItem *image_menu_item);
GtkContainerClass *container_class = (GtkContainerClass*) klass;
widget_class->destroy = gtk_image_menu_item_destroy;
- widget_class->screen_changed = gtk_image_menu_item_screen_changed;
widget_class->get_preferred_width = gtk_image_menu_item_get_preferred_width;
widget_class->get_preferred_height = gtk_image_menu_item_get_preferred_height;
widget_class->get_preferred_height_for_width = gtk_image_menu_item_get_preferred_height_for_width;
/**
* GtkImageMenuItem:always-show-image:
*
- * If %TRUE, the menu item will ignore the #GtkSettings:gtk-menu-images
- * setting and always show the image, if available.
+ * If %TRUE, the menu item will always show the image, if available.
*
- * Use this property if the menuitem would be useless or hard to use
+ * Use this property only if the menuitem would be useless or hard to use
* without the image.
*
* Since: 2.16
}
}
-static gboolean
-show_image (GtkImageMenuItem *image_menu_item)
-{
- GtkImageMenuItemPrivate *priv = image_menu_item->priv;
- GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (image_menu_item));
- gboolean show;
-
- if (priv->always_show_image)
- show = TRUE;
- else
- g_object_get (settings, "gtk-menu-images", &show, NULL);
-
- return show;
-}
-
static void
gtk_image_menu_item_map (GtkWidget *widget)
{
if (priv->image)
g_object_set (priv->image,
- "visible", show_image (image_menu_item),
+ "visible", priv->always_show_image,
NULL);
}
* @image_menu_item: a #GtkImageMenuItem
* @always_show: %TRUE if the menuitem should always show the image
*
- * If %TRUE, the menu item will ignore the #GtkSettings:gtk-menu-images
- * setting and always show the image, if available.
+ * If %TRUE, the menu item will always show the image, if available.
*
* Use this property if the menuitem would be useless or hard to use
* without the image.
if (priv->image)
{
- if (show_image (image_menu_item))
+ if (priv->always_show_image)
gtk_widget_show (priv->image);
else
gtk_widget_hide (priv->image);
* gtk_image_menu_item_get_always_show_image:
* @image_menu_item: a #GtkImageMenuItem
*
- * Returns whether the menu item will ignore the #GtkSettings:gtk-menu-images
- * setting and always show the image, if available.
+ * Returns whether the menu item will always show the image, if available.
*
* Returns: %TRUE if the menu item will always show the image
*
gtk_widget_set_parent (image, GTK_WIDGET (image_menu_item));
g_object_set (image,
- "visible", show_image (image_menu_item),
+ "visible", priv->always_show_image,
"no-show-all", TRUE,
NULL);
GTK_CONTAINER_CLASS (gtk_image_menu_item_parent_class)->remove (container, child);
}
}
-
-static void
-show_image_change_notify (GtkImageMenuItem *image_menu_item)
-{
- GtkImageMenuItemPrivate *priv = image_menu_item->priv;
-
- if (priv->image)
- {
- if (show_image (image_menu_item))
- gtk_widget_show (priv->image);
- else
- gtk_widget_hide (priv->image);
- }
-}
-
-static void
-traverse_container (GtkWidget *widget,
- gpointer data)
-{
- if (GTK_IS_IMAGE_MENU_ITEM (widget))
- show_image_change_notify (GTK_IMAGE_MENU_ITEM (widget));
- else if (GTK_IS_CONTAINER (widget))
- gtk_container_forall (GTK_CONTAINER (widget), traverse_container, NULL);
-}
-
-static void
-gtk_image_menu_item_setting_changed (GtkSettings *settings)
-{
- GList *list, *l;
-
- list = gtk_window_list_toplevels ();
-
- for (l = list; l; l = l->next)
- gtk_container_forall (GTK_CONTAINER (l->data),
- traverse_container, NULL);
-
- g_list_free (list);
-}
-
-static void
-gtk_image_menu_item_screen_changed (GtkWidget *widget,
- GdkScreen *previous_screen)
-{
- GtkSettings *settings;
- gulong show_image_connection;
-
- if (!gtk_widget_has_screen (widget))
- return;
-
- settings = gtk_widget_get_settings (widget);
-
- show_image_connection =
- g_signal_handler_find (settings, G_SIGNAL_MATCH_FUNC, 0, 0,
- NULL, gtk_image_menu_item_setting_changed, NULL);
-
- if (show_image_connection)
- return;
-
- g_signal_connect (settings, "notify::gtk-menu-images",
- G_CALLBACK (gtk_image_menu_item_setting_changed), NULL);
-
- show_image_change_notify (GTK_IMAGE_MENU_ITEM (widget));
-}
* /* make sure the type is realized */
* g_type_class_unref (g_type_class_ref (GTK_TYPE_IMAGE_MENU_ITEM));
*
- * g_object_set (gtk_settings_get_default (), "gtk-menu-images", FALSE, NULL);
+ * g_object_set (gtk_settings_get_default (), "gtk-enable-animations", FALSE, NULL);
* </programlisting></informalexample>
*
* There is one GtkSettings instance per screen. It can be obtained with
NULL);
g_assert (result == PROP_ENTRY_PASSWORD_HINT_TIMEOUT);
+ /**
+ * GtkSettings::gtk-menu-images:
+ *
+ * Whether images should be shown in menu items
+ *
+ * Deprecated: 3.10: This setting is ignored
+ */
result = settings_install_property_parser (class,
g_param_spec_boolean ("gtk-menu-images",
P_("Show menu images"),
P_("Whether images should be shown in menus"),
- TRUE,
+ FALSE,
GTK_PARAM_READWRITE),
NULL);
g_assert (result == PROP_MENU_IMAGES);